package com.lch.base.http.model.result;

import com.google.gson.annotations.SerializedName;

/**
 * API返回的结果基类
 * <T> API中返回的data 字段
 *
 * @author lee(29487113@qq.com) on 18/2/4
 */
public class BaseResult<T> implements java.io.Serializable {
    private static final long serialVersionUID = 1L;

    private static final int SUCCESS = 1;

    @SerializedName("code")
    public int code;

    @SerializedName("msg")
    public String msg;

    @SerializedName("data")
    public T data;

    public boolean isSuccess() {
        return code == SUCCESS;
    }


}
